Skip to content

feat(web-api): add highlight_type to files.completeUploadExternal and filesUploadV2#2594

Merged
zimeg merged 9 commits into
mainfrom
zimeg-feat-web-api-files-highlight
May 14, 2026
Merged

feat(web-api): add highlight_type to files.completeUploadExternal and filesUploadV2#2594
zimeg merged 9 commits into
mainfrom
zimeg-feat-web-api-files-highlight

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented May 13, 2026

Summary

This pull request adds highlight_type support to files.completeUploadExternal and the filesUploadV2 method.

The highlight_type parameter allows specifying the file type hint for uploads (e.g. png, jpg, gif), enabling optimistic rendering before the async upload processing job completes.

📚 https://docs.slack.dev/reference/methods/files.completeUploadExternal/

Changes

  • Added highlight_type to the FileUploadComplete interface (per-file in the files array)
  • Added highlight_type to FileUploadV2 so it can be specified when using filesUploadV2
  • Updated getAllFileUploadsToComplete to pass highlight_type through to each file object

Usage

import { LogLevel, WebClient } from '@slack/web-api';

const client = new WebClient(process.env.SLACK_BOT_TOKEN, { logLevel: LogLevel.DEBUG });

await client.filesUploadV2({
  channel_id: 'C0123456789',
  file: './image.png',
  filename: 'image.png',
  title: 'Image Upload',
  highlight_type: 'png',
  initial_comment: 'Uploaded with highlight_type for optimistic rendering',
});

Requirements

… filesUploadV2

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 13, 2026

🦋 Changeset detected

Latest commit: 50af6d9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@slack/web-api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.50%. Comparing base (963f9b0) to head (50af6d9).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2594      +/-   ##
==========================================
- Coverage   87.52%   87.50%   -0.02%     
==========================================
  Files          62       62              
  Lines       10228    10230       +2     
  Branches      418      418              
==========================================
  Hits         8952     8952              
- Misses       1254     1256       +2     
  Partials       22       22              
Flag Coverage Δ
cli-hooks 87.50% <100.00%> (-0.02%) ⬇️
cli-test 87.50% <100.00%> (-0.02%) ⬇️
logger 87.50% <100.00%> (-0.02%) ⬇️
oauth 87.50% <100.00%> (-0.02%) ⬇️
socket-mode 87.50% <100.00%> (-0.02%) ⬇️
web-api 87.50% <100.00%> (-0.02%) ⬇️
webhook 87.50% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@zimeg zimeg self-assigned this May 13, 2026
@zimeg zimeg added pkg:web-api applies to `@slack/web-api` enhancement M-T: A feature request for new functionality labels May 13, 2026
@zimeg zimeg added this to the web-api@7.x milestone May 13, 2026
@zimeg zimeg modified the milestones: web-api@7.x, web-api@next May 13, 2026
@zimeg zimeg marked this pull request as ready for review May 13, 2026 08:15
@zimeg zimeg requested a review from a team as a code owner May 13, 2026 08:15
Copy link
Copy Markdown
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise 🙏 thanks for working on this 💯

NOTE: I think this might be a minor rather then a patch since it introduces support for new functionality 🤔

zimeg and others added 5 commits May 13, 2026 18:16
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
Copy link
Copy Markdown
Member Author

zimeg commented May 14, 2026

@WilliamBergamin I appreciate your review so will merge this after a bit of discussion with the backend 🫡

We're now matching expected specs of the API and with filesUploadV2 🎁

@zimeg zimeg merged commit 2814969 into main May 14, 2026
18 of 20 checks passed
@zimeg zimeg deleted the zimeg-feat-web-api-files-highlight branch May 14, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality pkg:web-api applies to `@slack/web-api` semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants